package com.ali.ttt.mongo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;

import java.util.Arrays;

/**
 * @Author : yuxl
 * @create 2024/7/25 2:11 PM
 */
@Configuration
public class MongoConversions {
    @Bean
    public MongoCustomConversions mongoCustomConversions() {
        return new MongoCustomConversions(Arrays.asList(
                new LocalDateTimeToBsonDateTimeConverter(),
                new BsonDateTimeToLocalDateTimeConverter()
        ));
    }
}
